{extend name="public:common_edit"/}
{block name="main"}

<style>
    .tipStyle {
        display: none;
        position: absolute;
        background-color: #FBEC88;
        font-size: 16px;
        border-right: #D0EAF9 solid 1px;
        border-bottom: #D0EAF9 solid 1px;
        border-left: #D0EAF9 solid 1px;
        border-top: #D0EAF9 solid 1px;
    }

</style>

<div id="kyqToolTip" class="tipStyle"></div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
        </div>
        <div class="panel-body">

            <div class="navbar navbar-default">
                <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return false">
                    <div class="form-group">
                        <label class="control-label" for="input-order-id">用户昵称</label>
                        <div class="input-group">
                            <input type="text" name="nick_name" value="{$Think.get.nick_name}" placeholder="用户昵称"
                             class="form-control">
                        </div>

                    </div>
                    <button type="submit" onclick="javascript:document.getElementById('search-form2').submit();"
                            id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选
                    </button>

                </form>
            </div>
            <div id="ajax_return">
                <input type="checkbox" id="all" value="">全选
                <button class="bath_oper" data-type="success">批量通过</button>
                <button class="bath_oper" data-type="rollback">批量回退</button>
                <button class="bath_oper" data-type="delete">批量删除</button>

                <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <td>选择</td>
                                <td>id</td>
                                <td>用户</td>
                                <td>备注</td>
                                <td>修改后</td>
                                <td>修改前</td>
                                <td>修改时间</td>
                                <td>状态</td>
                                <td>操作</td>
                            </tr>
                            </thead>
                            <tbody>
                            <!-- 列表循环开始 -->
                            {volist name="rows" id="row" key="key"}
                            <tr>
                                <td><input type="checkbox"  name="id[]" value="{$row['check_id']}"></td>
                                <td>{$row.check_id}</td>
                                <td class="emojstext">{$row.nick_name}</td>
                                <td>{$row.remark}</td>
                                {switch name="row.type" }
                                {case value="1" }
                                <td><img modal="zoomImg" src="{$row.after}" style="max-width: 100px" alt=""></td>
                                <td><img modal="zoomImg" src="{$row.before}" style="max-width: 100px" alt=""></td>
                                {/case}
                                {case value="2" }
                                <td><img modal="zoomImg" src="{$row.after}" style="max-width: 100px" alt=""></td>
                                <td><img modal="zoomImg" src="{$row.before}" style="max-width: 100px" alt=""></td>
                                {/case}
                                {case value="3" }
                                <td class="txtstyle emojstext" data-str="{$row.after}">{:sub_str($row.after,20)}</td>
                                <td class="txtstyle emojstext" data-str="{$row.before}">{:sub_str($row.before,20)}</td>
                                {/case}
                                {case value="4" }
                                <td class="txtstyle emojstext" data-str="{$row.after}">{:sub_str($row.after,20)}</td>
                                <td class="txtstyle emojstext" emojstext data-str="{$row.before}">{:sub_str($row.before,20)}</td>
                                {/case}
                                {/switch}

                                <td>{$row.create_time}</td>
                                <td>{$row.status_text}</td>

                                <td>
                                    {if $row.status == 2}
                                    <a class="btn btn-primary  check_del" data-message="通过修改？" data-url="/user/edit/id/{$row.check_id}/status/1">通过</a>
                                    <a class="btn btn-primary check_del" data-message="回滚用户修改？" data-url="/user/edit/id/{$row.check_id}/status/0">回退</a>
                                    {/if}

                                    <span class="btn btn-danger check_del" data-message="" data-url="{:url('user/delete',['id'=>$row.check_id])}">删除</span>
                                </td>
                            </tr>
                            {/volist}
                            <!-- 列表循环结束 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
            <div id='pagerarea'>{$pageHTML}</div>
        </div>
    </div>
{/block}
{block name="js"}
<script src="__JS__/boxImg.js" type="text/javascript" ></script>
<link rel="stylesheet" type="text/css" href="__CSS__/boxImg.css">
<script>
    var pointX;
    var pointY;
    function add() {
        $("input[name='title'],input[name='name']").val('');
        $("input[name='pid']").val(0);
        $('#bjy-add').modal('show');
    }
    function showTip(str){

        if(str.length > 0){
            $("#kyqToolTip").css("display","block");
            $("#kyqToolTip").css("left",pointX+10);
            $("#kyqToolTip").css("top",pointY-10);
            $("#kyqToolTip").html(str);
        }
    }

    function closeTip() {
        $("#kyqToolTip").css("display","none");
    }


    $(function () {

        $.each($('.emojstext'),function (k,v) {
            var $text = $(v);
            var html = $text.html().trim().replace(/\n/g, '<br/>');
            html = jEmoji.softbankToUnified(html);
            html = jEmoji.googleToUnified(html);
            html = jEmoji.docomoToUnified(html);
            html = jEmoji.kddiToUnified(html);
            $text.html(jEmoji.unifiedToHTML(html));
        });


        // 添加菜单
        $(".txtstyle").bind("mouseover",function(e){
            pointX = e.pageX;
            pointY = e.pageY;
            var html = $(this).data('str');
            html = jEmoji.softbankToUnified(html);
            html = jEmoji.googleToUnified(html);
            html = jEmoji.docomoToUnified(html);
            html = jEmoji.kddiToUnified(html);
            showTip(jEmoji.unifiedToHTML(html));
        }).bind("mouseout",function(e){
            closeTip()
        }).bind("mousedown",function(e){
            closeTip()
        });


        var is_agent = "{$Think.get.is_agent}";
        $('#is_agent'+is_agent).attr('selected','selected')
    });
    var url = "{:url('user/batch')}";//删除
</script>

{include file="user/js" /}

{/block}




